#include <iostream>
using namespace std;

class MyPoint{
	int* p;
public:
	MyPoint(){ p = new int(0); }
	MyPoint(int* p) :p(p){}
	friend ostream& operator << (ostream& o, const MyPoint& p);
	int operator*(){
		//if (NULL == p) return 0;
		return *p;
	}
};
ostream& operator << (ostream& o, const MyPoint& p){
	return o << p.p;
}

int main(){
	int n = 6;
	cout << &n << endl;
	MyPoint p(&n);
	cout << p << endl;
	cout << *p << endl;

	while (1);
	return 0;
}